﻿using System.Collections.Generic;
using System.Linq;
using Trentacular.SharePoint.Deployment.Collections;
using System.Collections.ObjectModel;

namespace Trentacular.SharePoint.Deployment.Util
{
    public static class CollectionUtils
    {
        public static VirtualList<T> ToVirtualList<T>(this IEnumerable<T> enumerable)
        {
            return new VirtualList<T>(enumerable.ToList());
        }

        public static void Add<T>(this ObservableCollection<T> collection, IEnumerable<T> enumerable)
        {
            foreach (var item in enumerable)
            {
                collection.Add(item);
            }
        }
    }
}
